1. Technology Field
The invention generally relates to a data writing method, and more particularly, to a data writing method for writing update data into a non-volatile memory module, and a memory controller and a memory storage apparatus using the same.
2. Description of Related Art
In recently years, the consumers' demand to storage media for storing digital contents has increased drastically along with the widespread of digital cameras, cell phones, and MP3. Flash memory is one of the most adaptable storage media to be carried around and used for storing digital files due to its characteristics such as data non-volatility, low power consumption, small volume, and non-mechanical structure.
Based on the physical characteristics of flash memory, memory cells of a flash memory can only be programmed in a signal direction (i.e., each bit in the memory cells can only be programmed from 1 to 0). Thus, while writing data into the memory cells of a flash memory, data previously stored in the memory cells has to be erased before the new data is written.
Regarding the design of a flash memory storage system, the physical blocks in a flash memory of the flash memory storage system are usually grouped into a plurality of physical blocks. Each of the physical blocks has at least one flash memory cell. Each of the flash memory cells is composed of at least one transistor, such as a MOSFET or any other transistor or logic circuit. Each of the flash memory cells may store at least one bit. The physical blocks are grouped into a data area and a free area. The physical blocks in the data area have stored data, and the physical blocks in the free area are used for substituting the physical blocks in the data area when the write commands are executed. In order to allow a host to successfully access the physical blocks which are alternatively used for storing data, the flash memory storage system provides logical blocks to map to the physical blocks. To be specific, the flash memory storage system converts a logical access address to be accessed by the host into a corresponding logical block and records the mapping relationship between the logical blocks and the physical blocks in the data area in a logical block-physical block mapping table for reflecting the alternation of the physical blocks. Thus, the host accesses data simply according to the logical access address, while the flash memory storage system actually reads data from or writes data into the corresponding physical block according to the logical block-physical block mapping table.
To be specific, when the host is about to store data into a logical block, the flash memory storage system selects a physical block from the free area and writes the new data into the physical block (also referred to as a child physical block) selected from the free area to substitute the physical block (also referred to as a mother physical block) originally mapped to the logical block. Subsequently, at the right time, the flash memory storage system executes a data merging procedure to merge the valid data in the mother physical block and the child physical block (i.e., merges the data belonging to the logical block into the same physical block). For example, the flash memory storage system copies valid data in the mother physical block to the child physical block, re-maps the logical block to the child physical block (i.e., associates the child physical block to the data area), and erases the original mother physical block in the data area and associates it with the free area.
Based on the operational architecture of the flash memory storage system described above, when the host repeatedly updates data in the same logical page of the same logical block, the flash memory storage system has to execute the data merging and data erasing operations repeatedly. Thereby, the time for executing write commands will be prolonged, and the performance of the flash memory storage system will be reduced.
Nothing herein should be construed as an admission of knowledge in the prior art of any portion of the present invention. Furthermore, citation or identification of any document in this application is not an admission that such document is available as prior art to the present invention, or that any reference forms a part of the common general knowledge in the art.